package test.algos.sorting;

import test.algos.multiply.MultUtil;
import test.algos.multiply.GaussMultiply;
import test.algos.sorting.quicksort.QuickSort;
import test.algos.sorting.quicksort.RandomPivot;

public class Runner {

	/**
	 * @param args
	 * @throws ClassNotFoundException
	 * @throws IllegalAccessException
	 * @throws InstantiationException
	 */
	public static void main(String[] args) throws ClassNotFoundException,
			InstantiationException, IllegalAccessException {

		sortTest(args[0]);
		// numMultiplyTest();

	}

	private static void sortTest(String className)
			throws InstantiationException, IllegalAccessException,
			ClassNotFoundException {

		Sort sorter = new QuickSort(
				test.algos.sorting.input.InputData.INPUT_DATA,
				new RandomPivot());// (Sort)
									// Class.forName(className).newInstance();

		sorter.sort();
	}

	private static void numMultiplyTest() {

		Long num1 = 111111111L;
		Long num2 = 1111111L;

		GaussMultiply multiply = new GaussMultiply();
		Long result = multiply.multiply(num1, num2);

		Long result1 = (long) (num1 * num2);

		System.out.println(result);
		System.out.println(result1);
		System.out.println(result.equals(result1));

	}

}
